
<%@ page import="sushidiscount.Discount" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="sushiheader" />
        <g:set var="entityName" value="${message(code: 'discount.label', default: 'Discount')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="create" action="create">Nuevo Descuento</g:link></span>
        </div>
        <div class="body">
            <h1>Lista de Descuentos</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                                      
                            <g:sortableColumn property="sushiplace.name" title="Local &nbsp" />
                        
                            <g:sortableColumn property="percentage" title="Porcentaje &nbsp" />
                        
                            <g:sortableColumn property="payform" title="Forma de Pago &nbsp" />
                        
                            <g:sortableColumn property="membership" title="Tarjeta Socio &nbsp" />
                        
                            <g:sortableColumn property="aplicable" title="Aplicable sobre &nbsp" />
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${discountInstanceList}" status="i" var="discountInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                        
                            <td><g:link action="show" id="${discountInstance.id}">${fieldValue(bean: discountInstance, field: "sushiplace.name")}</g:link></td>
                        
                            <td>${fieldValue(bean: discountInstance, field: "percentage")}</td>
                        
                            <td>${fieldValue(bean: discountInstance, field: "payform")}</td>
                        
                            <td>${fieldValue(bean: discountInstance, field: "membership")}</td>
                        
                            <td>${fieldValue(bean: discountInstance, field: "aplicable")}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${discountInstanceTotal}" />
            </div>
        </div>

        <g:render template="/footer" />

    </body>
</html>
